//
//  QcInsertViewCell.m
//  QcMedical1
//
//  Created by jiawen Du on 2016/12/21.
//  Copyright © 2016年 jiawen Du. All rights reserved.
//

#import "QcInsertViewCell.h"

@implementation QcInsertViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

//获取当前时间
- (NSString *)getCurrnetTime
{
    NSDate *date = [NSDate date];
    NSDateFormatter *nowTime = [[NSDateFormatter alloc] init];
    [nowTime setDateFormat:@"YYYY-MM-dd"];
    NSString *dateStr = [nowTime stringFromDate:date];
    NSString *currnetTime = [@"预约时间:" stringByAppendingString:dateStr];
    return currnetTime;
}

-(void)setIfonModel:(QcDoctorsIfonModel *)ifonModel {
    _ifonModel = ifonModel;
    
    NSString *time = [self getCurrnetTime];
    self.time.text = time;
    self.sickPersonName.text = @"王先生";
 
    self.information.text = @"心塞";
    
    self.doctorName.text = ifonModel.doctor_name;
    self.doctorPosition.text = ifonModel.doctor_title_name;
    self.hospital.text = ifonModel.doctor_hospital_name;

   // NSLog(@"显示回传的model%p",ifonModel);
    
    if (ifonModel.applyState.intValue == 0) {
         self.state.text = @"未申请";
         self.viewColour.backgroundColor =[UIColor lightGrayColor];
        [self.state setTextColor:[UIColor redColor]];
    }
    
    if (ifonModel.applyState.intValue == 1) {
        self.state.text = @"已申请";
        self.viewColour.backgroundColor = [UIColor colorWithRed:69/255.0 green:178/255.0 blue:175/255.0 alpha:1];
      [self.state setTextColor:[UIColor whiteColor]];
        
    }
   
}



@end
